package com.sunchen.asc.service.user.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;

@Data
@ApiModel(value="新建user对象",description="用户对象user")
public class NewUserVo {

    @ApiModelProperty(value="姓名",name="name")
    @NotEmpty(message = "姓名不能为空")
    @Size(max=10,min=1,message = "姓名长度要在1-10之间")
    private String name;

    @ApiModelProperty(value="登录名",name="userName")
    @NotEmpty(message = "登录名不能为空")
    @Size(max=20,min=6,message = "登录名长度要在8-20之间")
    private String userName;

    @ApiModelProperty(value="电话",name="tel")
    @Pattern(regexp = "^[1][3,4,5,7,8][0-9]{9}$" , message = "电话号码有误")
    private String tel;

    @ApiModelProperty(value="性别（1：男2：女）",name="sex")
    @NotNull(message = "性别不能为空")
    private int sex;

    @ApiModelProperty(value="邮箱",name="email")
    @Email(message = "邮箱格式有误")
    private String email;

    @ApiModelProperty(value="状态（1：启用2：禁用）",name="status")
    @NotNull(message = "状态不能为空")
    private int status;

    @ApiModelProperty(value="描述",name="description")
    private String description;

    @ApiModelProperty(value="密码",name="password")
    @NotEmpty(message = "密码不能为空")
    @Size(max=20,min=6,message = "登录名长度要在6-20之间")
    private String password;
}
